﻿using System;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Threading.Tasks;
using System.Windows;
using ServiceDeskClient.ServiceDeskServiceReference;


namespace ServiceDeskClient
{
    /// <summary>
    /// Interaction logic for App.xaml
    /// </summary>
    public partial class App : Application
    {

        public App()
        {
            ShutdownMode = System.Windows.ShutdownMode.OnExplicitShutdown;
        }

        protected void Application_Startup(object sender, StartupEventArgs e)
        {

            try
            {
                var loginForm = new LoginWindow();

                loginForm.ShowDialog();

                var login = loginForm.Result;
                if (login != null)
                {
                    var mainForm = new MainWindow(login.Item1, login.Item2);
                    mainForm.ShowDialog();
                }
            }
            finally
            {
                Shutdown();
            }
        }
    }
}
